package com.rpcLearning.client;

import com.rpcLearning.client.impl.RandomSelector;
import com.rpcLearning.proto.Peer;
import com.rpcLearning.transport.TransportClient;
import com.rpcLearning.transport.impl.HTTPClient;
import com.rpclearnging.codec.Decoder;
import com.rpclearnging.codec.Encoder;
import com.rpclearnging.codec.impl.JsonDecoder;
import com.rpclearnging.codec.impl.JsonEncoder;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

/**
 * @author:zyh
 * @Time:2021-03-17-21:15
 * @email:1269231889@qq.com
 */
@Data
public class RpcClientConfig {
    private Class<? extends TransportClient> transport = HTTPClient.class;
    private Class<? extends Encoder> encoder = JsonEncoder.class;
    private Class<? extends Decoder> decoder = JsonDecoder.class;
    private Class<? extends TransportSelector> selector = RandomSelector.class;

    //默认每个端口连接一个client
    private int connectCount = 1;
    private List<Peer> servers = Arrays.asList(new Peer("127.0.0.1", 3000));
}
